-- GENERATED SPELL FOR [Twilight Master] --


function spell0_11883(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(12058,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11883', 3000, 1)
end

function spell1_11883(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(13339,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11883', 526, 1)
end

function spell2_11883(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_11883', 8298, 1)
end

function spell3_11883(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(9672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11883', 7000, 1)
end

function Sorts_11883(pUnit, Event)
local choix_sorts_11883 = math.random(0, 3)
if choix_sorts_11883 == 0 then
pUnit:RegisterEvent('spell0_11883', 1, 1)
end
if choix_sorts_11883 == 1 then
pUnit:RegisterEvent('spell1_11883', 1, 1)
end
if choix_sorts_11883 == 2 then
pUnit:RegisterEvent('spell2_11883', 1, 1)
end
if choix_sorts_11883 == 3 then
pUnit:RegisterEvent('spell3_11883', 1, 1)
end
end

function mob11883_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11883', math.random(1500, 3000), 1)
end

function mob11883_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11883_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11883_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11883, 1, 'mob11883_Action')
RegisterUnitEvent(11883, 2, 'mob11883_Leave')
RegisterUnitEvent(11883, 3, 'mob11883_Kill')
RegisterUnitEvent(11883, 4, 'mob11883_Die')
